function getFormattedDate(timestamp) {
    const currentDate = new Date();
    const targetDate = new Date(timestamp);
    const currentYear = currentDate.getFullYear();
    const targetYear = targetDate.getFullYear();

    const year = (currentYear === targetYear) ? currentYear % 100 : targetYear;
    const month = ('0' + (targetDate.getMonth() + 1)).slice(-2);
    const day = ('0' + targetDate.getDate()).slice(-2);
    const hours = ('0' + targetDate.getHours()).slice(-2);
    const minutes = ('0' + targetDate.getMinutes()).slice(-2);

    if (currentYear === targetYear) {
        return `${month}/${day}/${year}:${hours}:${minutes}`;
    } else {
        return `${targetYear}/${month}/${day}/${year}:${hours}:${minutes}`;
    }
}

export function isOneMinuteApart(time1, time2) {
    const diffMs = Math.abs(time1 - time2);
    const minuteMs = 60 * 1000; // 一分钟的毫秒数

    return diffMs >= minuteMs;
}

export default getFormattedDate;